﻿Namespace Forms.Edit

	<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
	Public Class frmDiplomaSuperTypeDetails
		Inherits org.codegen.win.controls.frmBaseEdit

#Region "Designer"
		'Form overrides dispose to clean up the component list.
		<System.Diagnostics.DebuggerNonUserCode()> _
		Protected Overrides Sub Dispose(ByVal disposing As Boolean)
			Try
				If disposing AndAlso components IsNot Nothing Then
					components.Dispose()
				End If
			Finally
				MyBase.Dispose(disposing)
			End Try
		End Sub

		Friend WithEvents UcDiplomaSuperType As ucDiplomaSuperTypeDetails

		'Required by the Windows Form Designer
		Private components As System.ComponentModel.IContainer

		'NOTE: The following procedure is required by the Windows Form Designer
		'It can be modified using the Windows Form Designer.  
		'Do not modify it using the code editor.
		<System.Diagnostics.DebuggerStepThrough()> _
		Private Sub InitializeComponent()
            Me.UcDiplomaSuperType = New IIC.ucDiplomaSuperTypeDetails()
            Me.SuspendLayout()
            '
            'UcDiplomaSuperType
            '
            Me.UcDiplomaSuperType.AutoValidate = System.Windows.Forms.AutoValidate.EnableAllowFocusChange
            Me.UcDiplomaSuperType.Dock = System.Windows.Forms.DockStyle.Fill
            Me.UcDiplomaSuperType.isInitialized = False
            Me.UcDiplomaSuperType.Location = New System.Drawing.Point(0, 30)
            Me.UcDiplomaSuperType.ModelObject = Nothing
            Me.UcDiplomaSuperType.Name = "UcDiplomaSuperType"
            Me.UcDiplomaSuperType.Size = New System.Drawing.Size(573, 137)
            Me.UcDiplomaSuperType.TabIndex = 0
            '
            'frmDiplomaSuperTypeDetails
            '
            Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
            Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
            Me.ClientSize = New System.Drawing.Size(573, 189)
            Me.Controls.Add(Me.UcDiplomaSuperType)
            Me.Name = "frmDiplomaSuperTypeDetails"
            Me.ShowAdd = True
            Me.ShowDelete = True
            Me.ShowNavigationButtons = True
            Me.Text = "Diploma Type"
            Me.Controls.SetChildIndex(Me.UcDiplomaSuperType, 0)
            Me.ResumeLayout(False)
            Me.PerformLayout()

        End Sub

#End Region

#Region "Standard Code"

		Public Overrides Sub DeleteData()

			Dim mapper As DiplomaSuperTypeDBMapper = New DiplomaSuperTypeDBMapper()
			mapper.deleteByKey(Me.IdValue)

			'after delete, close the form
			'Note: do not set the dialog result here.  It is handled by the frmBaseEdit, ie do not call Me.DialogResult = Windows.Forms.DialogResult.None

		End Sub

		Public Overrides Sub LoadData()

			Me.UcDiplomaSuperType.ModelObject = New DiplomaSuperTypeDBMapper().findByKey(Me.IdValue)
			Me.UcDiplomaSuperType.loadData()
			Me.setRecordLoadedStatus(Me.IdValue)

		End Sub


        Public Overrides Function SaveData() As enumSaveDataResult

            If Me.ValidateChildren() Then

                Me.UcDiplomaSuperType.loadToObject()

                Dim db As New DiplomaSuperTypeDBMapper()
                db.save(Me.UcDiplomaSuperType.ModelObject)

                If Me.NewRecord AndAlso Application.OpenForms("frmMain") IsNot Nothing Then
                    CType(Application.OpenForms("frmMain"), frmMain). _
                       ucSystemTree.addDiplomaSuperType( _
                     CType(Me.UcDiplomaSuperType.ModelObject, DiplomaSuperType))
                End If

                Return enumSaveDataResult.SAVE_SUCESS_AND_CLOSE
            Else
                Return enumSaveDataResult.SAVE_FAIL
            End If

        End Function

		Public Overrides Function dataChanged() As Boolean

			Return Me.UcDiplomaSuperType.hasChanges

		End Function

		''' <summary>
		''' On the load, we need to call "resetLastLoadedValues"
		''' at the **end** of the method.  This call keeps track of the 
		''' loaded data on the page, for the 'datachanged' functionality
		''' </summary>
		Private Sub frm_Load(ByVal sender As Object, _
								ByVal e As System.EventArgs) Handles Me.Load

			'**** any code should go before "resetLastLoadedValues"


			'***** IMPORTANT: keep this call at the end of the procedure
			Call Me.UcDiplomaSuperType.resetLastLoadedValues()

		End Sub

#End Region

	End Class

End Namespace

